home *** CD-ROM | disk | FTP | other *** search
/ Business Shareware / Business Shareware.iso / start / hobby / aa_51 / annuab.c < prev    next >
C/C++ Source or Header  |  1993-02-09  |  795b  |  46 lines

  1. /* Annual aberration - AA pages B17, B37, C24
  2.  */
  3.  
  4. #include "kep.h"
  5.  
  6. int annuab( p )
  7. double p[]; /* unit vector pointing from earth to object */
  8. {
  9. double A, B, C;
  10. double betai, pV;
  11. double x[3], V[3];
  12. int i;
  13.  
  14. /* Calculate the velocity of the earth (see vearth.c).
  15.  */
  16. velearth( TDT );
  17. C = 173.1446327; /* speed of light in au/day */
  18. betai = 0.0;
  19. pV = 0.0;
  20. for( i=0; i<3; i++ )
  21.     {
  22.     A = vearth[i]/C;
  23.     V[i] = A;
  24.     betai += A*A;
  25.     pV += p[i] * A;
  26.     }
  27. /* Make the adjustment for aberration.
  28.  */
  29. betai = sqrt( 1.0 - betai );
  30. C = 1.0 + pV;
  31. A = betai/C;
  32. B = (1.0  +  pV/(1.0 + betai))/C;
  33.  
  34. for( i=0; i<3; i++ )
  35.     {
  36.     C = A * p[i]  +  B * V[i];
  37.     x[i] = C;
  38.     dp[i] = C - p[i];
  39.     }
  40.  
  41. showcor( "annual aberration", p, dp );
  42. for( i=0; i<3; i++ )
  43.     p[i] = x[i];
  44. return(0);
  45. }
  46.